/*
 * SortedBuffer.h
 *
 *  Created on: 06/02/2014
 *      Author: Bruno
 */

#ifndef SORTEDBUFFER_H_
#define SORTEDBUFFER_H_

#include <iostream>
#include "Tuple.h"

using namespace std;

struct Node{

	Tuple * elem;
	Node * sig;
};

class SortedBuffer {

private:
	Node* buff;
	int sizeBuff;

public:
	SortedBuffer();
	bool isEmpty();
	void push(Tuple * t);
	int size();
	Tuple* pop();
	void insert(Tuple ** buff, int countT);
	int popKTuples(int numTuples, Tuple ** buff);
	void clean();
	void print();
	virtual ~SortedBuffer();
};


ostream &operator<< (ostream &stream, SortedBuffer &comp);

#endif /* SORTEDBUFFER_H_ */
